#include "SpriteNode.hpp"
#include <iostream>
#include <string>
void SpriteNode::drawSelf(sf::RenderTarget& target, sf::RenderStates states) const {
    target.draw(sprite, states);
}
SpriteNode::SpriteNode(sf::String file_name, bool is_local_player) :x_velocity(0), y_velocity(0), is_local_player(is_local_player) {
    if (!texture.loadFromFile(file_name.toAnsiString())) {
        std::cerr << "Can't load " << file_name.toAnsiString() << '\n';
    }
    sprite.setTexture(texture);
}
unsigned int SpriteNode::getCategory() const {
    return CategoryType::SPRITE_NODE;
}

const sf::Vector2f& SpriteNode::getTargetPosition() const {
    return target_position;
}

void SpriteNode::setTargetPosition(const sf::Vector2f& pos) {
    target_position = pos;
}

void SpriteNode::updateSelf(sf::Time dt) {

}

bool SpriteNode::isLocalPlayer() const {
    return is_local_player;
}